
$ErrorActionPreference = "Stop"

$codePath = "./src/main/"
$dataPath = "./resources/dataGen/data/"
$dbPath = "./resources/db/"
$tempPath = "./temp/launcher/"

# Data generation profile: ./resources/dataGen/std.txt
# Delete folder ./resources/dataGen/data/ and re-run.

$dataGen = "./resources/dataGen/"
if (-not (Test-Path $dataPath) -or -not (Get-ChildItem $dataPath)) {
    Push-Location $dataGen
    & "./run"
    Pop-Location
}

g++ "./src/launcher/main.cpp" -o "./launcher.exe" -O2 -Wall --std=c++17
& "./launcher.exe" $codePath $dataPath $dbPath $tempPath
Remove-Item "./launcher.exe"
